package store.lunangangster.engine.impl.entity;

import java.util.HashMap;
import java.util.Map;

public class ByteArrayEntityImpl extends EntityImpl implements ByteArrayEntity {

  protected String name;
  protected byte[] bytes;

  @Override
  public void setName(String name) {
    this.name = name;
  }

  @Override
  public void setBytes(byte[] bytes) {
    this.bytes = bytes;
  }

  @Override
  public String getName() {
    return name;
  }

  @Override
  public byte[] getBytes() {
    return bytes;
  }

  @Override
  public Object getPersistState() {
    Map<String, Object> persistState = new HashMap<>();
    persistState.put("name", name);
    persistState.put("bytes", bytes);
    return persistState;
  }
}
